package com.niiwoo.civet.scheduler.trigger;/**
 * Created by DELL on 2017/12/19.
 */

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Reference;
import com.niiwoo.civet.account.service.check.AccountCheckingJobDubboService;

import lombok.extern.slf4j.Slf4j;

/**
 * 对账Job
 *
 * @author zhoulinquan
 * @create 2017-12-29 14:14
 **/
@Component
@Slf4j
public class AccountCheckingJobTrigger {

    @Reference(version = "1.0.0")
    private AccountCheckingJobDubboService accountCheckingJobDubboService;

    /**
     * 对账定时任务
     */
    @Scheduled(cron = "${account.checking}")
    public void accountCheckingJob(){
        long startTime = System.currentTimeMillis();
        log.info("==========accountCheckingJob start==========");
        accountCheckingJobDubboService.startAccountCheckingJob(null);
        log.info("==========accountCheckingJob end, cost:{} ms==========", System.currentTimeMillis() - startTime);
    }

}
